-- GENERATED SPELL FOR [Fen Lord] --


function spell0_1041(pUnit, Event) --@Poison,n/a--
pUnit:FullCastSpellOnTarget(744,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1041', 30000, 1)
end

function spell1_1041(pUnit, Event) --@Summon Fen Dweller,Self--
pUnit:FullCastSpellOnTarget(8857,pUnit)
pUnit:RegisterEvent('Sorts_1041', 578, 1)
end

function Sorts_1041(pUnit, Event)
local choix_sorts_1041 = math.random(0, 1)
if choix_sorts_1041 == 0 then
pUnit:RegisterEvent('spell0_1041', 1, 1)
end
if choix_sorts_1041 == 1 then
pUnit:RegisterEvent('spell1_1041', 1, 1)
end
end

function mob1041_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1041', math.random(1500, 3000), 1)
end

function mob1041_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1041_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1041_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1041, 1, 'mob1041_Action')
RegisterUnitEvent(1041, 2, 'mob1041_Leave')
RegisterUnitEvent(1041, 3, 'mob1041_Kill')
RegisterUnitEvent(1041, 4, 'mob1041_Die')
